<script>
import * as echarts from '@/uni_modules/lime-echart/static/echarts.min'
export default {
  name: "echarts",
  props: {
    option: {
      type: Object,
      default: () => {}
    },
    width: {
      type: String,
      default: "100%"
    },
    height: {
      type: String,
      default: "100%"
    }
  },
  data() {
    return {
      chart: null
    }
  },

  methods: {
    init() {
      this.$refs.chart.init(echarts, chart=> {
        chart.setOption(this.option);
      });
    }
  },
}
</script>

<template>
  <view><l-echart ref="chart" @finished="init"></l-echart></view>
</template>

<style scoped lang="scss">

</style>